
--hive退回汇总
DROP TABLE IF EXISTS jms_dm.dm_customer_reback_net_sum_dt ;
create external table jms_dm.dm_customer_reback_net_sum_dt
(
  date_time             string    COMMENT '申请时间'
  ,sender_network_name  string    COMMENT '寄件(揽收)网点名称'
  ,sender_network_code  string    COMMENT '寄件(揽收)网点code'
  ,customer_code        string    COMMENT '客户code'
  ,customer_name        string    COMMENT '客户名称'
  ,waybill_sum          bigint  COMMENT '退回件量'
)
COMMENT '退回件网点客户维度'
PARTITIONED BY ( dt STRING COMMENT '退回申请日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_customer_reback_net_sum_dt'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
    );

--hive退回明细
DROP TABLE IF EXISTS jms_dm.dm_customer_reback_net_detail_dt ;
create external table jms_dm.dm_customer_reback_net_detail_dt
(
  waybill_no           string COMMENT '单号'
  ,date_time           string COMMENT '申请时间'
  ,sender_network_name string COMMENT '寄件(揽收)网点名称'
  ,sender_network_code string COMMENT '寄件(揽收)网点code'
  ,customer_code       string COMMENT '客户code'
  ,customer_name       string COMMENT '客户名称'
  ,apply_type_name     string COMMENT '退回类型默认：退回'
)
COMMENT '退回件明细'
PARTITIONED BY ( dt STRING COMMENT '退回申请日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_customer_reback_net_detail_dt'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
    );

--hive破损
DROP TABLE IF EXISTS jms_dm.dm_customer_worn_net_sum_dt ;
create external table jms_dm.dm_customer_worn_net_sum_dt
(
  date_time            string    COMMENT '申请时间'
  ,sender_network_name  string    COMMENT '寄件(揽收)网点名称'
  ,sender_network_code  string    COMMENT '寄件(揽收)网点code'
  ,customer_code        string    COMMENT '客户code'
  ,customer_name        string    COMMENT '客户名称'
  ,waybill_sum          bigint  COMMENT '破损件量'
)
COMMENT '破损件网点客户维度'
PARTITIONED BY ( dt STRING COMMENT '破损申请日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_customer_worn_net_sum_dt'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
    );

--hive遗失
DROP TABLE IF EXISTS jms_dm.dm_customer_loss_net_sum_dt ;

create external table jms_dm.dm_customer_loss_net_sum_dt
(
  date_time            string    COMMENT '申请时间'
  ,sender_network_name  string    COMMENT '寄件(揽收)网点名称'
  ,sender_network_code  string    COMMENT '寄件(揽收)网点code'
  ,customer_code        string    COMMENT '客户code'
  ,customer_name        string    COMMENT '客户名称'
  ,waybill_sum          bigint  COMMENT '遗失件量'
)
COMMENT '遗失件网点客户维度'
PARTITIONED BY ( dt STRING COMMENT '遗失结案日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_customer_loss_net_sum_dt'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
    );
